/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model.Dao;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author Trung
 */
public class DataAccess {
    public ResultSet rs = null;
    public Connection con = null;
    public PreparedStatement ps = null;
    public String driverString = null;
    public String connectionString = null;

    public DataAccess() {
        driverString = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
        connectionString = "jdbc:sqlserver://localhost:1433;database=OnlineLibrary;user=sa;password=123456";
        try {            
            Class.forName(driverString);
            con = DriverManager.getConnection(connectionString);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(DataAccess.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(DataAccess.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
}
